<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" type="text/css" href="__CSS__/main.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/common.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/bootstrap.min.css" />
    <script type="text/javascript" src="__EXTEND__/lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="__EXTEND__/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="__EXTEND__/lib/layer/2.4/layer.js"></script>
    <![endif]-->
    <title></title>
</head>
<body>
<div class="contant">
<div class="row">
    <div class="top">首页>第三方征信查询（同盾）</div>
    <div class="content addapply">
        <div class="fl">
            <div class="box all-box">
                <h1>客户信息<span>(标*为必填项)</span></h1>
                <div class="list-block">
                    <div class="row">
                        <input id="report-id" type="hidden" value={$info.report_id}>
                        <label>姓名: <i class="required">*</i></label>
                        <input disabled type="text" value={$info.user_name}>
                        <label>身份证号: <i class="required">*</i></label>
                        <input disabled style="width: 160px;" type="text" value={$info.identity_no}>
                        <label>贷款银行: <i class="required">*</i></label>
                        <input disabled type="text" value={$info.bank_name}>
                    </div>
                    <div class="row">
                        <label>上传照片: <i class="required">*</i></label>
                        <label class="inputfile" for=""><a target="_blank" href="{$info.identity_photo_pros}" class="preview" rel="{$info.identity_photo_pros}"><img class="pic" src="{$info.identity_photo_pros}" ><i>身份证正面</i></a></label>
                        <label class="inputfile" for=""><a target="_blank" href="{$info.identity_photo_cons}" class="preview" rel="{$info.identity_photo_cons}"><img class="pic" src="{$info.identity_photo_cons}" ><i>身份证反面</i></a></label>
                        <label class="inputfile" for=""><a target="_blank" href="{$info.credit_authorize_photo}" class="preview" rel="{$info.credit_authorize_photo}"><img class="pic" src="{$info.credit_authorize_photo}" ><i>征信授权书</i></a></label>
                        <label class="inputfile" for=""><a target="_blank" href="{$info.credit_authorize_up}" class="preview" rel="{$info.credit_authorize_up}"><img class="pic" src="{$info.credit_authorize_up}" ><i>征信授权书抬头</i></a></label>
                        <label class="inputfile" for=""><a target="_blank" href="{$info.credit_authorize_down}" class="preview" rel="{$info.credit_authorize_down}"><img class="pic" src="{$info.credit_authorize_down}" ><i>征信授权书低头</i></a></label>
                        <label class="inputfile" for=""><a target="_blank" href="{$info.table_credit_photo}" class="preview" rel="{$info.table_credit_photo}"><img class="pic" src="{$info.table_credit_photo}" ><i>征信表格照片</i></a></label>
                    </div>
                    <div class="row {$info['spouse_name']?'':'sr-only'}">
                        <label>配偶姓名: <i class="required">*</i></label>
                        <input disabled type="text" name="" value={$info.spouse_name}>
                        <label>身份证号: <i class="required">*</i></label>
                        <input disabled style="width: 160px;" type="text" name="" value={$info.spouse_identity_no}>
                    </div>
                    <div class="row {$info['spouse_name']?'':'sr-only'}">
                        <label>上传照片: <i class="required">*</i></label>
                        <label class="inputfile" for=""><a target="_blank" href="{$info.spouse_id_photo_pros}" class="preview" rel="{$info.spouse_id_photo_pros}"><img class="pic" src="{$info.spouse_id_photo_pros}" ><i>身份证正面</i></a></label>
                        <label class="inputfile" for=""><a target="_blank" href="{$info.spouse_id_photo_cons}" class="preview" rel="{$info.spouse_id_photo_cons}"><img class="pic" src="{$info.spouse_id_photo_cons}" ><i>身份证反面</i></a></label>
                        <label class="inputfile" for=""><a target="_blank" href="{$info.spouse_credit_photo}" class="preview" rel="{$info.spouse_credit_photo}"><img class="pic" src="{$info.spouse_credit_photo}" ><i>征信授权书</i></a></label>
                        <label class="inputfile" for=""><a target="_blank" href="{$info.spouse_credit_up}" class="preview" rel="{$info.spouse_credit_up}"><img class="pic" src="{$info.spouse_credit_up}" ><i>征信授权书抬头</i></a></label>
                        <label class="inputfile" for=""><a target="_blank" href="{$info.spouse_credit_down}" class="preview" rel="{$info.spouse_credit_down}"><img class="pic" src="{$info.spouse_credit_down}" ><i>征信授权书低头</i></a></label>
                    </div>
                    <volist name="assure" id="assure_data">
                        <div class="row">
                            <label>担保人姓名: <i class="required">*</i></label>
                            <input disabled type="text" name="" value={$assure_data.user_name}>
                            <label>身份证号: <i class="required">*</i></label>
                            <input disabled style="width: 160px;" name="" value={$assure_data.identity_no}>
                        </div>
                        <div class="row">
                            <label>上传照片: <i class="required">*</i></label>
                            <label class="inputfile" for=""><a target="_blank" href="{$assure_data.assume_credit_photo}" class="preview" rel="{$assure_data.assume_credit_photo}"><img class="pic" src="{$assure_data.assume_credit_photo}" ><i>身份证正面</i></a></label>
                            <label class="inputfile" for=""><a target="_blank" href="{$assure_data.assure_id_photo_pros}" class="preview" rel="{$assure_data.assure_id_photo_pros}"><img class="pic" src="{$assure_data.assure_id_photo_pros}" ><i>身份证反面</i></a></label>
                            <label class="inputfile" for=""><a target="_blank" href="{$assure_data.assure_id_photo_cons}" class="preview" rel="{$assure_data.assure_id_photo_cons}"><img class="pic" src="{$assure_data.assure_id_photo_cons}" ><i>提交征信授权书</i></a></label>
                            <label class="inputfile" for=""><a target="_blank" href="{$assure_data.credit_up_photo}" class="preview" rel="{$assure_data.credit_up_photo}"><img class="pic" src="{$assure_data.credit_up_photo}" ><i>征信授权书抬头照</i></a></label>
                            <label class="inputfile" for=""><a target="_blank" href="{$assure_data.credit_down_photo}" class="preview" rel="{$assure_data.credit_down_photo}"><img class="pic" src="{$assure_data.credit_down_photo}" ><i>征信授权书低头照</i></a></label>
                        </div>
                    </volist>
                </div>
            </div>
        </div>
        <div class="fr">
        <form id="third_form" method="post">
            <div class="box all-box">
                <h1>信用记录</h1>
                <div class="list-block">
                    <div class="row">
                        <label>借款人信息:<i class="required">*</i></label>
                        <input type="hidden" name="user_id" value={$info.id}>
                        <input type="hidden" id="apply-status" name="check_status" value=''>
                        <input type="hidden" id="score" name="score" value=''>
                        <textarea name="master_info" id="" cols="38" rows="5">{$info.master_info}</textarea>
                    </div>
                    <div class="row {$info['spouse_name']?'':'sr-only'}">
                        <label>配偶人信息:<i class="required">*</i></label>
                        <textarea name="spouse_info" id="" cols="38" rows="5">{$info.spouse_info}</textarea>
                    </div>
                    <volist  name="assure" id="assure_info" >
                        <div class="row">
                            <label>担保人信息:<i class="required">*</i></label>

                            <input type="hidden" value="{$assure_info.id}" name="aids[]">
                            <textarea name="assure_{$assure_info.id}" id="" cols="38" rows="5">{$assure_info.assure_info}</textarea>
                        </div>
                    </volist>
                </div>
                <div class="list-block">
                    <input  id="third-adopt" type="submit" class="button01" value="提交">
                    <input type="button" class="button01" value="暂不提交">
                    <input id="tongdun-check" type="button" class="btn btn-warning" value="同盾查询" data-toggle="modal" data-target="#tongdun">
                </div>
            </div>
            <div class="list-block">
                <input type="submit" class="button01" value="提交">
                <input type="button" class="button01" value="重置">
            </div>
            </form>
        </div>
    </div>
</div>
</div>

<!-- Button trigger modal -->
<!-- 同盾查询 -->

<!-- Modal -->
<div class="modal fade" id="tongdun" tabindex="-1" role="dialog" aria-labelledby="tongdunLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="tongdunLabel">贷前审核报告</h4>
      </div>
      <div class="modal-body">
        <div id="final_score"></div>
      </div>
    </div>
  </div>
</div>

<style type="text/css">
    i{cursor: pointer;}
    .pic{
        width:138px;
        height:118px;
        border-radius:0% ;
        cursor: pointer;
        background: #fff;
        /*position: absolute;
        */z-index: 1;
    }

    #preview{
        position:absolute;border:1px solid #ccc;
        background:#333;padding:3px;display:none;color:#fff;
        opacity: .9;
    }

</style>
<script type="text/javascript">

//    this.imagePreview = function(){
//        xOffset = 10;
//        yOffset = 30;
//
//        $("a.preview").hover(function(e){
//                    this.t = this.title;
//                    this.title = "";
//                    var c = (this.t != "") ? "<br/>" + this.t : "";
//                    $("body").append("<div id='preview'><img width=600 src='"+ this.rel +"' alt='Image preview' />"+ c +"</div>");
//                    $("#preview")
//                            .css("top",(e.pageY - xOffset) + "px")
//                            .css("left",(e.pageX + yOffset) + "px")
//                            .fadeIn("fast");
//                },
//                function(){
//                    this.title = this.t;
//                    $("#preview").remove();
//                });
//        $("a.preview").mousemove(function(e){
//            $("#preview")
//                    .css("top",(e.pageY - xOffset) + "px")
//                    .css("left",(e.pageX + yOffset) + "px");
//        });
//    };


    // starting the script on page load
    $(document).ready(function(){
        imagePreview();
    });

    $('#tongdun-check').click(function(){
        report_id         = $('#report-id').val();
        console.log(report_id);

        $.ajax(
        {
            type: "POST",
            url: "__URL__/preloanReport",
            data:
            {
                report_id:report_id
            },
            success: function(msg)
            {
                obj_data = $.parseJSON(msg);
                console.log(obj_data);
                if (obj_data.success) {
                    report_time = obj_data.report_time;
                    report_time = report_time.toString();

                    switch(obj_data.final_decision){
                        case 'Accept':
                            final_decision = '建议通过';
                            break;
                        case 'Review':
                            final_decision = '建议审核';
                            break;
                        case 'Reject':
                            final_decision = '建议拒绝';
                            break;
                    }

                    showData =
                    '<div>'+
                            '风险分数：'+obj_data.final_score+'<br>'+
                            '风险结果：'+final_decision+'<br>'+
                            '报告编号：'+obj_data.report_id+'<br>'+
                            '报告时间：'+getDateTime(report_time.substr(0,10))+'<br>'+
                            '信用分：'+obj_data.credit_score+'<br>'+
                            '身份证所属地：'+obj_data.address_detect.id_card_address+'<br>'+
                            '银行卡所属地：'+obj_data.address_detect.bank_card_address+'<br>'+
                            '手机所属地：'+obj_data.address_detect.mobile_address+'<br>'+
                    '</div>';
                    $('#score').val(obj_data.final_score);
                    $('#final_score').empty().append(showData);

                }else{
                    $('#extra-info').append('<div class="bule">'+obj_data.reason_desc+'</div>');
                }
           }
        });
    });

    $('#third-adopt').click(function(){
        $('#apply-status').val(-1);
        if (confirm('确认通过吗？')==true){
            $('#third_form').submit();
        }else{
            return false;
        }
    });

    /**
     * 时间戳转换日期
     * @param <int> unixTime    待时间戳(秒)
     * @param <bool> isFull    返回完整时间(Y-m-d 或者 Y-m-d H:i:s)
     * @param <int>  timeZone   时区
     */
    function getDateTime(unixTime, isFull, timeZone) {
        if (typeof (timeZone) == 'number')
        {
            unixTime = parseInt(unixTime) + parseInt(timeZone) * 60 * 60;
        }
        var time = new Date(unixTime * 1000);
        var ymdhis = "";
        ymdhis += time.getUTCFullYear() + "-";
        ymdhis += (time.getUTCMonth()+1) + "-";
        ymdhis += time.getUTCDate();
        if (isFull === true)
        {
            ymdhis += " " + time.getUTCHours() + ":";
            ymdhis += time.getUTCMinutes() + ":";
            ymdhis += time.getUTCSeconds();
        }
        return ymdhis;
    }




</script>
</body>
</html>